package com.dxd.entity;

import java.util.List;

public class PageEntity<T> {

	private List<T> list;// 数据

	private int first = 1;// 第一页

	private int last;// 最后一页

	private int front;// 上一页

	private int next;// 下一页

	private int page;// 当前页

	private int size;// 每页显示条数

	private int totalCount;// 总记录数、

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		last = (totalCount + size - 1) / size;
		this.totalCount = totalCount;
	}

	public int getFirst() {
		first = 1;
		return first;
	}

	public void setFirst(int first) {
		this.first = first;
	}

	public int getLast() {
		return last;
	}

	public void setLast(int last) {
		this.last = last;
	}

	public int getFront() {
		front = page > 1 ? page - 1 : 1;
		return front;
	}

	public void setFront(int front) {
		this.front = front;
	}

	public int getNext() {
		next = page < last ? page + 1 : last;
		return next;
	}

	public void setNext(int next) {
		this.next = next;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

}
